interface FnInterface {
    name: string
    age: number
}
const fn = <T>(data: T): T => {
    return data
}

const result = fn<FnInterface>({ name: 'Lacy', age: 19 })

function fn2<T>(data: T): T {
    return data
}

const resultTwo = fn2<FnInterface>({ name: 'Jack', age: 10 })

// array
interface ExampleArrayInterface {
    prop: string
    children: any[]
}

const example_array: Array<ExampleArrayInterface> = [
    {
        prop: 'prop-1',
        children: ['Bob']
    }
]

interface List<T = any> {
    page: number | string
    size: number | string
    data: T[]
}

const getList = <T>(data: T[]): List<T> => {
    return {
        page: 1,
        size: 10,
        data
    }
}

interface D {
    title: string
    id: string | number
    content: string
}
const _data: D = {
    title: 'example',
    id: 1,
    content: "It's a fine day today"
}
const data = getList<D>([_data])
